<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 
            通过绝对定位的方式实现布局：
            1.设置最外部容器高度为100%
            2.让子元素相对定位，并且设置元素最小高度为100%
            3.在中间区域设置padding-bottom为footer的高度
            4.底部栏绝对定位，并一直吸附在底部即可
        */
        
        body {
            margin: 0;
            height: 100vh;
        }
        
        .main {
            position: relative;
            min-height: 100%;
        }
        
        .container {
            height: 400px;
            display: flex;
            padding-bottom: 100px;
        }
        
        .left {
            height: 200px;
            width: 200px;
            background-color: #f759ab;
        }
        
        .content {
            height: 200px;
            background-color: #52c41a;
            flex: 1;
        }
        
        .right {
            /* height: 400px; */
            width: 200px;
            background-color: #f759ab;
        }
        
        .left,
        .content,
        .right {
            font-size: 70px;
            line-height: 100px;
            text-align: center;
        }
        
        .header {
            height: 100px;
            background-color: #70a1ff;
        }
        
        .footer {
            height: 100px;
            background-color: #ff7a45;
            position: absolute;
            width: 100%;
            bottom: 0;
        }
        
        .header,
        .footer {
            line-height: 100px;
            font-size: 52px;
            text-align: center;
        }
    </style>
</head>

<body>

    <div class="main">
        <div class="header">header</div>
        <div class="container">
            <div class="left">left</div>
            <div class="content">content</div>
            <div class="right">right</div>
        </div>
        <div class="footer">footer</div>
    </div>
</body>

</html>